package com.feign.controller;

import com.feign.entity.User;
import com.feign.service.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    @Autowired
    private HelloService helloService;

    @RequestMapping(value = "/feign-consumer",method = RequestMethod.GET)
    public String helloConsumer(){

        return helloService.hello();

    }

    @RequestMapping(value = "/say",method = RequestMethod.GET)
    public String say(){
        return helloService.say("小明","过年回家真高兴，哈哈！");
    }

    @RequestMapping(value = "/getUserInfo",method = RequestMethod.GET)
    public String getUserInfo(){
        User user = new User();
        user.setName("小丽");
        user.setAge(19);

        return helloService.helloUser(user);
    }

}
